package com.amoyt.project.domain.vo;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

/**
 * @Date: 2025/8/24
 * @Time: 11:31
 * @Author: TQ_QT
 * @Description:
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class OperationLogVo {
    @Schema(description = "日志ID（主键）")
    private Long logId;

    @Schema(description = "操作人ID（关联sys_user.id）")
    private String operatorId;

    @Schema(description = "操作人姓名（冗余存储，避免关联查询）")
    private String operatorName;

    @Schema(description = "业务名称")
    private String businessName;

    @Schema(description = "请求路径：/api/admin/user/add")
    private String requestPath;

    @Schema(description = "业务模块（归类API，如：用户管理、订单管理）")
    private String businessModule;


    @Schema(description = "操作类型：1-新增 2-修改 3-删除 4-查询 5-登录 6-登出 7-导入 8-导出 9-其他")
    private Integer operationType;

    @Schema(description = "方法参数（JSON格式，如：{'userId':1,'userName':'张三'}）")
    private String methodParams;

    @Schema(description = "操作结果：1-成功 0-失败")
    private Integer operationResult;

    @Schema(description = "结果数据（成功时存储关键返回值，如：{'userId':1}；失败时可存null）")
    private String resultData;

    @Schema(description = "操作IP地址（支持IPv4/IPv6）")
    private String ipAddress;

    @Schema(description = "客户端信息（如浏览器/APP版本，如：Mozilla/5.0...）")
    private String userAgent;

    @Schema(description = "错误信息（操作失败时存储异常栈信息，成功时为null）")
    private String errorMsg;

    @Schema(description = "操作时间（默认当前时间）")
    private LocalDateTime operationTime;
}
